package com.example.myapplication.util;

/**
 * @author: rongfeng
 * @date: 2022/8/24
 * @description
 */
public class Match {

    static void APY()// 计算年利率
    {
        int year, n;
        double q, F, P;
//        System.out.printf("复利终值:");
        F = 370;
//        System.out.printf("存入本金:");
        P = 100;
//        System.out.printf("存入年限:");
        year = 10;
//        System.out.printf("年复利次数:");
        n =1;
        q = n * (Math.pow(F / P, 1.0 / (year * n)) - 1);
        System.out.println();
        System.out.println("从" + P + "到" + F + "需要" + q);
    }

}
